package com.regent.central.bill.common;

/**
 * 数据改变类型
 *
 * @author 钟宝林
 * @date 2018-06-23 10:47
 **/
public enum DataChangeType {

    SYSTEM_AUTO("系统自动", 0),
    USER_OPERATE("用户手动", 1);

    private final String name;
    private final int value;

    DataChangeType(String name, int value) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public int getValue() {
        return value;
    }

    public static DataChangeType value(int value) {
        for (DataChangeType item : DataChangeType.values()) {
            if (item.getValue() == value) {
                return item;
            }
        }
        throw new IllegalArgumentException("未知状态");
    }

}
